<!DOCTYPE html>
<html><meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CentOS 安装ali yum 源</title>
<style type="text/css">
    body{
        background-color: #3C3F41;
    }
    a{
        text-decoration: none;
        color: #fbfbff;
    }
</style>
<body><head>
    <style type="text/css">
        nav ul {
            list-style-type: none;
            margin: 0;
            padding: 0;
            overflow: hidden;
            background-color: #333;
            position: -webkit-sticky;  
            position: sticky;
            top: 0;
        }

        nav li {
            float: left;
        }

        nav li a {
            display: block;
            color: white;
            text-align: center;
            padding: 14px 16px;
            text-decoration: none;
        }

         
        nav li a:hover {
            background-color: #111;
        }
        .active {
            background-color: #4CAF50;
        }
    </style>
</head>

<nav>
    <ul>
        
        
        <li><a href="/blog/">home</a></li>
         
        
        <li><a href="/blog/post">博文</a></li>
         
        
        <li><a href="/blog/about">about</a></li>
         
    </ul>
</nav>
<div id="content" style="margin: auto;width: 50%;padding: 10px; color: #ffffff;height: 100%">
    <article>
        <header>
            <h1 class="post-title">CentOS 安装ali yum 源</h1>
        </header>
        <p>centos8 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#安装base reop源</span>
</span></span><span style="display:flex;"><span>cd /etc/yum.repos.d
</span></span><span style="display:flex;"><span><span style="color:#75715e">#接着备份旧的配置文件</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo mv CentOS-Base.repo CentOS-Base.repo.bak
</span></span><span style="display:flex;"><span><span style="color:#75715e">#下载阿里源的文件</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
</span></span><span style="display:flex;"><span><span style="color:#75715e">#安装epel repo源</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">#epel(RHEL 7)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
</span></span><span style="display:flex;"><span><span style="color:#75715e">#清理缓存</span>
</span></span><span style="display:flex;"><span>yum clean all
</span></span><span style="display:flex;"><span><span style="color:#75715e">#重新生成缓存</span>
</span></span><span style="display:flex;"><span>yum makecache
</span></span></code></pre></div>
        <br />

        <div>
            
            <a href="https://alittlesmile.gitee.io/blog/post/docker/docker%E5%8A%A0%E9%80%9Fali%E9%95%9C%E5%83%8F%E4%BB%93%E5%BA%93/">&lt; CentOS 安装ali yum 源</a>
            

            
            <a href="https://alittlesmile.gitee.io/blog/post/mysql/mysql-%E4%B9%90%E8%A7%82%E9%94%81%E6%82%B2%E8%A7%82%E9%94%81/" style="float:right">2022 03 26 ></a>
            
        </div>
    </article>

</div></body>
</html>
